Creates a new DiagramLink instance between the specified nodes and adds it to the links collection of the underlying diagram.
Namespace: MindFusion.Diagramming
File: Factory.js
JavaScript Copy Code |
---|
function createDiagramLink ( |
DiagramNode. The origin node.
Number | TreeViewItem. The zero-based index of the origin table row or the origin tree item of the new link.
DiagramNode. The destination node.
Number | TreeviewItem. The zero-based index of the destination table row or the destination tree item of the new link.
The newly created DiagramLink instance.
If the origin or destination argument refers to a TableNode, it can be optionally followed by a row index specifying the origin or destination row. If the origin or destination argument refers to a TreeViewNode, it can be optionally followed by a TreeViewItem argument specifying the origin or destination item. If index / item arguments are omitted, the link connects to the specified node as a target instead of specific element inside.
The following script demonstrates various Factory method calls.
JavaScript Copy Code |
---|
function buildDiagram(diagram) |